package com.sky.controller.user;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.sky.entity.Category;
import com.sky.result.Result;
import com.sky.service.CategoryService;
import com.sky.service.UserService;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;

@RestController("usercategorycontroller")
@RequestMapping("user/category")
@Api(tags="用户端菜品的相关接口")
@Slf4j
public class CategoryController {
	@Autowired
	UserService userservice;
	
	@GetMapping("/list")
	@ApiOperation("菜品查询接口")
	public Result<List<Category>> categoryList(Integer type)
	{
		log.info("菜品的查询接口的参数：{}",type);
		List<Category> categorylist = userservice.categoryList(type);
		return Result.success(categorylist);
	}
}
